<!DOCTYPE html>
<html>
<head>
	<title>专栏作者</title>
	<meta charset="utf-8">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="default">
    <meta name="viewport" content="user-scalable=no,width=device-width,initial-scale=1,maximum-scale=1">
	<link rel="stylesheet" type="text/css" href="css/style.css">
	<link rel="stylesheet" type="text/css" href="css/author.css">
	<script src="./js/jquery-1.12.4.min.js"></script>
</head>
<body>
<?php include_once('config/header.php'); ?>

<div class="advertisement">
	<div class="advert-tit">
		<div class="title" id="content_title">专栏作者</div>
		<p>让你的作品赋予区块链行业的思想，成就区块链的聚集地</p>
	</div>
</div>
<div class="authors">
	<div class="author-left">
		<img class="author-touxiang" src="" id="head_pic">
	</div>
	<div class="author-middle">
		<div class="author-name" id="member_name"></div>
		<div class="author-data">
			<div class="author-information">
				<ul>
					<li>文章数</li>
					<li>点击量</li>
					<li>获赞数</li>
					<li>评论数</li>
				</ul>
			</div>
			<div class="author-number">
				<ul>
					<li id="consult"></li>
					<li id="browse"></li>
					<li id="like"></li>
					<li id="diss"></li>
				</ul>
			</div>
		</div>
		<div class="author-introduction" id="signature">
			作者简介：知名财经专栏作家，黄金市场资深研究员；大宗商品、外汇市场观察员，比特币等电子货币研究人士。
		</div>
	</div>
	<div  class="author-right">
		<div class="author-buttom">
			<div class="author-gz">关注</div>
		</div>			
	</div>
</div>
<div class="content">
	<div class="article">
		<div class="article-left">
			<div class="article-nav" id="article_nav">
				<ul>
					<li class="dis-li" data-v="1"><p>文章</p> <span id="text_num">0</span></li>
					<li data-v="2"><p>评论</p> <span id="diss_num">0</span></li>
				</ul>
			</div>
			<div class="text">
				<div id="article">
					<div class="list">
						<a href="article.html"><img src="./images/201811200020216214-380x228.png" class="img"></a>
						<div class="con">
							<a href="article.html"><div class="title">是大神大所多撒</div></a>
							<p>阿萨德撒案发发的好了健康</p>
							<div class="author">
								<div class="left">
									<img src="./images/201811200020216214-380x228.png" class="head_pic">
									<a class="member_name">阿萨德</a>
									<img src="./images/dian.png" class="dian">
									<span>12</span>
									<img src="./images/dian.png" class="dian">
									<a class="label" href="#">12</a>
								</div>
								<div class="right">
									<a href=""><img src="./images/zan.png"></a>
									<p>100</p>
									<img src="./images/eye.png">
									<p>9999</p>
									<img src="./images/comment1.png">
									<p>20</p>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class="article-right">
			<?php include_once('config/ranking2.php'); ?>

		</div>
	</div>
</div>

<?php include_once('config/footer.php'); ?>
</body>
<script type="text/javascript" src="./js/function.js"></script>
</html>
<script type="text/javascript">
$(function(){
	var userId = GetQueryString('id');
	//获取用户信息
	var author_url = 'http://'+document.domain+"/index/data/authorInfo";
	$.ajax({
		type: 'POST',
        url: author_url,
        data:{userId:userId},
        dataType: 'json',
        success: function(result){
        	$('#consult').html(result['consult']);
        	$('#browse').html(result['browse']);
        	$('#like').html(result['like']);
        	$('#diss').html(result['diss']);
        	$('#signature').html(result['signature']);
        	$('#head_pic').attr('src',result['head_pic']);
        	$('#text_num').html(result['consult']);
        	$('#diss_num').html(result['diss']);
        	$('#member_name').html(result['member_name']);
        	var html = '';
        	result['consult_list'].forEach((item,i)=>{
        		html += '<div class="list">';
					html += '<a href="article.php?id='+result['consult_list'][i]['id']+'"><img src="'+result['consult_list'][i]['img']+'" class="img"></a>';
					html += '<div class="con">';
						html += '<a href="article.php?id='+result['consult_list'][i]['id']+'"><div class="title">'+result['consult_list'][i]['title']+'</div></a>';
						html += '<p>'+result['consult_list'][i]['abstract']+'</p>';
						html += '<div class="author">';
							html += '<div class="left">';
								html += '<img src="'+result['head_pic']+'" class="head_pic">';
								html += '<a class="member_name">'+result['member_name']+'</a>';
								html += '<img src="./images/dian.png" class="dian">';
								html += '<span>'+timestampToTime(result['consult_list'][i]['addtime'])+'</span>';
								html += '<img src="./images/dian.png" class="dian">';
								result['consult_list'][i]['label_v'].forEach((item,j)=>{
									html += '<a class="label" href="label.php?id='+result['consult_list'][i]['label_v'][j]['id']+'">'+result['consult_list'][i]['label_v'][j]['name']+'</a>';
								})
							html += '</div>';
							html += '<div class="right">';
								html += '<a href=""><img src="./images/zan.png"></a>';
								html += '<p>'+result['consult_list'][i]['like']+'</p>';
								html += '<img src="./images/eye.png">';
								html += '<p>'+result['consult_list'][i]['look']+'</p>';
								html += '<img src="./images/comment1.png">';
								html += '<p>'+result['consult_list'][i]['comments']+'</p>';
							html += '</div>';
						html += '</div>';
					html += '</div>';
				html += '</div>';
        	})
        	$('#article').html(html);
        },
	})

	$('#article_nav ul li').click(function(){
		$(this).addClass('dis-li');
		$(this).siblings().removeClass('dis-li');
		var vid = $(this).attr('data-v');
		var html = '';
		if (vid == 1) {
			var consult_url = 'http://'+document.domain+"/index/data/ConsultList";
			$.ajax({
				type: 'POST',
		        url: consult_url,
		        data:{userId:userId},
		        dataType: 'json',
		        success: function(result){
		        	result.forEach((item,i)=>{
						html += '<div class="list">';
							html += '<a href="article.php?id='+result[i]['id']+'"><img src="'+result[i]['img']+'" class="img"></a>';
							html += '<div class="con">';
								html += '<a href="article.php?id='+result[i]['id']+'"><div class="title">'+result[i]['title']+'</div></a>';
								html += '<p>'+result[i]['abstract']+'</p>';
								html += '<div class="author">';
									html += '<div class="left">';
										html += '<img src="'+result[i]['head_pic']+'" class="head_pic">';
										html += '<a class="member_name">'+result[i]['member_name']+'</a>';
										html += '<img src="./images/dian.png" class="dian">';
										html += '<span>'+timestampToTime(result[i]['addtime'])+'</span>';
										html += '<img src="./images/dian.png" class="dian">';
										result[i]['label_v'].forEach((item,j)=>{
											html += '<a class="label" href="label.php?id='+result[i]['label_v'][j]['id']+'">'+result[i]['label_v'][j]['name']+'</a>';
										})
									html += '</div>';
									html += '<div class="right">';
										html += '<a href=""><img src="./images/zan.png"></a>';
										html += '<p>'+result[i]['like']+'</p>';
										html += '<img src="./images/eye.png">';
										html += '<p>'+result[i]['look']+'</p>';
										html += '<img src="./images/comment1.png">';
										html += '<p>'+result[i]['comments']+'</p>';
									html += '</div>';
								html += '</div>';
							html += '</div>';
						html += '</div>';
					})
					$('#article').html(html);
			    }
			})
		}else if(vid == 2){
			var comments_url = 'http://'+document.domain+"/index/data/CommentsList";
			$.ajax({
				type: 'POST',
		        url: comments_url,
		        data:{userId:userId},
		        dataType: 'json',
		        success: function(result){
		        	result.forEach((item,i)=>{
		        		html += '<div class="list2">';
							html += '<div class="con">';
								html += '<a href="article.html"><div class="title">是大神大所多撒</div></a>';
								html += '<p>反过来，不明白的是，按照正方资料推广说到，维卡币已经升到全球数字货币的排行榜第二位，按照所秀出的虚拟币网站登入观看第二名不是原来资料图示的维卡币，而是另外一家，这到底怎么回事呢反过来，不明白的是，按照正方资料推广说到，维卡币已经升到全球数字货币的排行榜第二位，按照所秀出的虚拟币网站登入观看第二名不是原来资料图示的维卡币，而是另外一家，这到底怎么回事呢</p>';
								html += '<div class="author">';
									html += '<div class="left">';
										html += '<img src="./images/zan.png">';
										html += '<a class="member_name">点赞 123&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>';
										html += '<img src="./images/zan.png">';
										html += '<a class="member_name">点赞 123&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>';
										html += '<img src="./images/zan.png">';
										html += '<a class="member_name">点赞 123&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>';
									html += '</div>';
									html += '<div class="right"> 2018-10-10 </div>';
								html += '</div>';
							html += '</div>';
						html += '</div>';
					})
					$('#article').html(html);
			    }
			})
		}
		$('#article').html(html);
	})
})
</script>